import Popover from "../../packages/popover";

describe("Popover", () => {
  it("动态设置placement", () => {
    cy.mount(Popover, {
        propsData: {
            placement: 'bottom',
            content: '123123'
        },
        slots: {
            reference: `<div style='margin-top: 120px'>hover激活</div>`
        },
        stubs: {
            transition: false
        }
    });


    cy.contains('hover激活').click()
    cy.get('[role="tooltip"]').should('have.attr', 'x-placement', 'bottom');
    cy.contains('hover激活').click()

    cy.get('@vue').invoke('setProps', { placement: 'top' })

    cy.contains('hover激活').click()
    cy.get('[role="tooltip"]').should('have.attr', 'x-placement', 'top');
  });
});
